<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	    <meta name="format-detection" content="telephone=no">
	    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
	    <link href="../../css/bootstrap.css" rel="stylesheet" />
	    <link href="../../css/cover.css" rel="stylesheet" />
	    <link href="../../css/font-awesome.min.css" rel="stylesheet" />
	    <title>荆州千网汇信息科技有限公司</title>
	    <script src="../../js/jquery-2.2.3.min.js"></script>
	    <script src="../../js/jquery.flexslider-min.js"></script>
	    <script src="../../js/rem.js"></script>
	    <script src="../../js/itnetcao.js"></script>
	    <link href="../../js/layui/css/layui.css" rel="stylesheet" />
	    <link href="../../js/donghua/animsition.min.css" rel="stylesheet" />
	    <script src="../../js/donghua/animsition.min.js"></script>
	    <link rel="stylesheet" href="../../css/minirefresh.css" />
	    <link rel="stylesheet" href="../../css/common.css" />
	    <script type="text/javascript" src="../../js/minirefresh.js"></script>
	    <script type="text/javascript" src="../../js/common.js"></script>
	    <script type="text/javascript" src="../../js/qrcode.min.js"></script>
	    
	    
	    
		<title>exchange</title>
	</head>
	<body style='width:100%;height:100%;'>
		<div class="page_top01 relative">
            <h3 class="text-center">我的二维码</h3>
            <a href="javascript:;" class="animsition-link" data-animsition-out-class="fade-out-right" data-animsition-out-duration="500" onclick="history.go(-1)">
                <img src="../../images/icon_left.png" class="img-responsive reture_img" /></a>
        </div>
        <div class='setImageWH' style='background:url(../../image/wodeerewima.jpg);background-size:cover;'>
			<div class="body" style='display:inline-block;position:absolute;z-index:10000;top:0;left:0;'>
		      	<div style='margin:10px;padding:10px;' id='qrCode' align="center"></div>
			</div>

	      	<div align="center" style='color:#FFF;white-space:break-word;word-break:break-all;display:inline-block;position:absolute;z-index:10000;top:85%;left:0;'>
	      		<div style='text-align:center;color:#FFF;'>
	      			您的推荐码连接
	      		</div>
	      		<div class='myQrCodeUrl' id="myQrCodeUrl" style='z-index:10001;border:0px;background:black;height:60px;color:#FFF;white-space:break-word;word-break:break-all;display:inline-block;'>
	      			
	      		</div> 
	      		<div>
	      			<button class="layui-btn layui-btn-xs btn">复制</button>
	      		</div>
	      	</div>

		</div>
	</body>
<script type="text/javascript" src="../../js/clipboard.min.js"></script>
<script type='text/javascript'>
$(function() {
	var clipboard = new ClipboardJS('.btn', {
		text : function() {
			return $("#myQrCodeUrl").text();
		}
	});
	
	clipboard.on('success', function(e) {
		console.log(e);
	    alert("复制成功,请向您的朋友发送该注册地址吧.");
	});
	
	clipboard.on('error', function(e) {
	    alert("非常抱歉,复制功能貌似出现了问题,您可以联系管理员解决.");
	});
})
var qrcode = new QRCode(document.getElementById("qrCode"), {
render:'canvas||table',
	width : 200,
	height : 200
});

$(".myQrCodeUrl").css({"width" : $(window).width()})

$(".setImageWH").css({"width" : $(window).width(), "height" : $(window).height() - parseFloat($(".page_top01").css("height").replace("px", ""))});

var width = ($(window).width() - 250) / 2;
var height = ($(window).height()) / 2;

$(".body").css({"left" : width, "top" : parseFloat(height) - 30});
function makeCode (code) {
	
	qrcode.makeCode(localStorage.getItem("url") + "/user/controller/UserQrCodeToRegister.do?code=" + code);
	
	$(".myQrCodeUrl").text(localStorage.getItem("url") + "/user/controller/UserQrCodeToRegister.do?code=" + code);
}

$(function() {
	var url = localStorage.getItem("url") + "/user/controller/UserFindByIdAPP.do";
	var data = "userId=" + jQuery.parseJSON(localStorage.getItem("miningmachine_user")).userId;
	itcao.itGetAjaxBigData(url, data).done(function(result) {
		var qrCode = jQuery.parseJSON(result).bean.userMyQrCode;
		makeCode(qrCode);
	})
})
</script>
</html>
